<template>
  <div class="box">
    <span class="num" :style="{ transform: `translate(-50%, -${number * 10}%)` }" v-if="number != '.'">0123456789</span>
    <span v-else class="dot">.</span>
  </div>
</template>

<script setup>
import { onMounted } from "vue"

const props = defineProps({
  number: {
    type: [Number, String],
    default: 5,
    required: true,
  },
})

onMounted(() => {})
</script>

<style lang="scss" scoped>
.box {
  height: 54px;
  line-height: 104px;
  border-radius: 4px;
  width: 42px;
  min-width: 42px;
  text-align: center;
  // CSS属性定义文本行是否水平或垂直布置以及块扩展的方向。
  writing-mode: vertical-lr;
  // 文字方向  竖直
  text-orientation: upright;
  position: relative;
  overflow: hidden;
  letter-spacing: 16px;
  color: #3487ff;
  background: linear-gradient(180deg, #e9f2fb 0%, #f0f5ff 100%);
  box-shadow: inset 2px 2px 3px 0px rgba(0, 0, 0, 0.07);
  font-family: "AlibabaPuHuiTi_2_115_Black";
}
.num {
  font-size: 32px;
  position: absolute;
  left: 50%;
  top: 12px;
  transition: all 1.5s;
}
.dot {
  font-size: 38px;
  line-height: 0;
  position: absolute;
  left: 12px;
  bottom: -10px;
  opacity: 0.5;
}
</style>
